package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.cnswhy.cloud.common.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 商品相册(t_shop_product_gallery)
 * </p>
 *
 * @author cnswhy
 * @since 2020-11-17
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_shop_product_gallery")
@ApiModel(value = "ShopProductGallery", description = "商品相册(t_shop_product_gallery)")
@AllArgsConstructor
public class ShopProductGallery extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 商品主键
     */
    @ApiModelProperty(value = "商品主键")
    @TableField("product_id")
    @Excel(name = "商品主键")
    private Long productId;

    /**
     * 缩略图路径
     */
    @ApiModelProperty(value = "缩略图路径")
    @Length(max = 255, message = "缩略图路径长度不能超过255")
    @TableField(value = "thumbnail", condition = LIKE)
    @Excel(name = "缩略图路径")
    private String thumbnail;

    /**
     * 小图路径
     */
    @ApiModelProperty(value = "小图路径")
    @Length(max = 255, message = "小图路径长度不能超过255")
    @TableField(value = "small", condition = LIKE)
    @Excel(name = "小图路径")
    private String small;

    /**
     * 大图路径
     */
    @ApiModelProperty(value = "大图路径")
    @Length(max = 255, message = "大图路径长度不能超过255")
    @TableField(value = "big", condition = LIKE)
    @Excel(name = "大图路径")
    private String big;

    /**
     * 原图路径
     */
    @ApiModelProperty(value = "原图路径")
    @Length(max = 255, message = "原图路径长度不能超过255")
    @TableField(value = "original", condition = LIKE)
    @Excel(name = "原图路径")
    private String original;

    /**
     * 极小图路径
     */
    @ApiModelProperty(value = "极小图路径")
    @Length(max = 255, message = "极小图路径长度不能超过255")
    @TableField(value = "tiny", condition = LIKE)
    @Excel(name = "极小图路径")
    private String tiny;

    /**
     * 是否是默认图片1   0没有默认
     */
    @ApiModelProperty(value = "是否是默认图片1   0没有默认")
    @TableField("is_defailt")
    @Excel(name = "是否是默认图片1   0没有默认")
    private Integer isDefailt;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    @TableField("sort")
    @Excel(name = "排序")
    private Integer sort;


    @Builder
    public ShopProductGallery(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createUser, Long updateUser, 
                    Long productId, String thumbnail, String small, String big, String original, 
                    String tiny, Integer isDefailt, Integer sort) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createUser = createUser;
        this.updateUser = updateUser;
        this.productId = productId;
        this.thumbnail = thumbnail;
        this.small = small;
        this.big = big;
        this.original = original;
        this.tiny = tiny;
        this.isDefailt = isDefailt;
        this.sort = sort;
    }

}
